proc compcfire
    loop
	userx := Rand.Int (1, 10)
	usery := Rand.Int (1, 10)
	exit when userloc (userx, usery) = 1
    end loop
    loop
	if userloc (userx, usery) = 1 then
	    putout ("Comp: HIT!")
	    coloursq (GridWin, red, userx, usery)
	    userloc (userx, usery) := 2
	    exit
	elsif userloc (userx, usery) = 2 or userloc (userx, usery) = 3 then
	    putout ("Comp: Already fired there!")
	    exit
	else
	    coloursq (GridWin, blue, userx, usery)
	    userloc (userx, usery) := 3
	    putout ("Comp: Miss")
	    exit
	end if
    end loop
end compcfire
